Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JuliaFormatter & workflow #482

Merged
merged 21 commits into from
Oct 8, 2021
Merged

JuliaFormatter & workflow #482

merged 21 commits into from
Oct 8, 2021

Conversation

st--
Copy link
Contributor

@st-- st-- commented Oct 7, 2021

Resolves #462. Supersedes #463.

@codecov-commenter
Copy link

codecov-commenter commented Oct 7, 2021

Codecov Report

Merging #482 (ffddfe4) into master (834901e) will increase coverage by 0.07%.
The diff coverage is 82.79%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #482      +/-   ##
==========================================
+ Coverage   92.92%   93.00%   +0.07%     
==========================================
  Files          15       15              
  Lines         791      800       +9     
==========================================
+ Hits          735      744       +9     
  Misses         56       56              
Impacted Files Coverage Δ
src/compat.jl 44.44% <0.00%> (ø)
src/config.jl 100.00% <ø> (ø)
src/ignore_derivatives.jl 75.00% <0.00%> (ø)
src/tangent_types/abstract_zero.jl 85.00% <33.33%> (ø)
src/tangent_types/notimplemented.jl 72.00% <66.66%> (+1.16%) ⬆️
src/rule_definition_tools.jl 96.27% <82.35%> (+0.09%) ⬆️
src/tangent_types/tangent.jl 84.37% <84.78%> (ø)
src/accumulation.jl 97.22% <100.00%> (ø)
src/projection.jl 98.15% <100.00%> (+0.03%) ⬆️
src/tangent_arithmetic.jl 96.42% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 834901e...ffddfe4. Read the comment docs.

@sethaxen
Copy link
Member

sethaxen commented Oct 7, 2021

I think we want to follow BlueStyle?

By default, JuliaFormatter uses its own style, not BlueStyle. Can you check in a .JuliaFormatter.toml containing just style = "blue" and then re-run JuliaFormatter?

Also, now would be a good time to add the BlueStyle badge to the ReadMe.

Copy link
Member

@mzgubic mzgubic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not review the .yml file.

IMO overall this is an improvement in readability, and I am ok to accept formatter dictatorship on a few cases where the current way of writing (e.g. aligning vertically) is more readable.

Copy link
Member

@oxinabox oxinabox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks nice work.
We need to look at it again once it has been set to BlueStyle.

@st--
Copy link
Contributor Author

st-- commented Oct 7, 2021

I think we want to follow BlueStyle?

By default, JuliaFormatter uses its own style, not BlueStyle. Can you check in a .JuliaFormatter.toml containing just style = "blue" and then re-run JuliaFormatter?

Sure. In the end, I think it's more important to have an automatic formatter than what the style is, exactly.:)

@st--
Copy link
Contributor Author

st-- commented Oct 7, 2021

Also, now would be a good time to add the BlueStyle badge to the ReadMe.

There's one already:
image

@st-- st-- requested a review from oxinabox October 7, 2021 10:30
Copy link
Contributor

@nickrobinson251 nickrobinson251 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally, i am against having a formatter CI job, because in my experience it is more pain than it is worth (and i say that as both the biggest contributor to BlueStyle and the person who worked with Dom to have it added to JuliaFormatter.jl). But i am not one of the bigger contributors here so am happy enough to be out voted

I am neutral about running the formatter as a one-off over the existing code (it makes style a bit more consistent but interferes with gt blame), but if we are to do that we should use BlueStyle only (whereas this PR currently includes changes that makes the style "worse" (according to BlueStyles) because it also includes changes made first be a different style, so i think those should be removed before this is merged

@st--
Copy link
Contributor Author

st-- commented Oct 7, 2021

personally, i am against having a formatter CI job, because in my experience it is more pain than it is worth (and i say that as both the biggest contributor to BlueStyle and the person who worked with Dom to have it added to JuliaFormatter.jl). But i am not one of the bigger contributors here so am happy enough to be out voted

Personally, in my experience the pain from dealing with the autoformatter is much smaller than all the pain from arguments about style that are completely removed by having the autoformatter. But of course also happy for the core maintainers to vote as they see fit!

I am neutral about running the formatter as a one-off over the existing code (it makes style a bit more consistent

We can simply remove the formatter workflow from this PR again and just keep the formatting changes if you want to do that:)

but interferes with git blame),

A bit, but it's easy enough to "blame previous to this commit" (in the GitHub UI even easier than on the commandline):)

but if we are to do that we should use BlueStyle only

I've now removed all the changes from the previous format run, so its current state is BlueStyle changes only.

@st--
Copy link
Contributor Author

st-- commented Oct 7, 2021

@oxinabox @sethaxen it's now properly following BlueStyle. do you want to accept it as is now, or just the format changes minus github action workflow, or is there anything else you'd like to change about it ?

Comment on lines +308 to +309
Tangent{Tuple{Float64,Float64}}(4.0, 8.0) ==
Tangent{Tuple{Float64,Float64}}(2.0, 4.0) * 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this change is required by BlueStyle.
But I don't think it is forbidden either,
It is fine

@oxinabox
Copy link
Member

oxinabox commented Oct 7, 2021

OK, this worked out better than I initially expected seeing the PR.
Good.

I think we can merge this once the outstanding comments are solved.
Of which there are not so many and they are not too bad.

Excellent. Very nice work

@st-- st-- requested a review from oxinabox October 8, 2021 05:36
@st--
Copy link
Contributor Author

st-- commented Oct 8, 2021

Looks like the reviewdog doesn't actually make the suggestion for how to fix a line (so you could simply accept the review suggestion, instead of having to fix it manually). Not sure why that is - github actions permissions lacking ?

@oxinabox oxinabox merged commit 70f73c5 into JuliaDiff:master Oct 8, 2021
@oxinabox
Copy link
Member

oxinabox commented Oct 8, 2021

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

check whitespace as part of CI?
7 participants